<template>
	<!-- 设置切换账号 -->
	<view class="list-start-card bac-color-fff font-size-15 font-color-000">
		<navigator url="/pages/login/index" class="start-item flex align-center">
			<view class="mar-l-10 flex-1">
				<text>切换账号</text>
			</view>
			<mk-icon :src="''" :height="16" :width="16"></mk-icon>
		</navigator>
		<view class="start-item flex align-center mar-t-20" @click="clearOut">
			<view class="mar-l-10 flex-1">
				<text>退出登录</text>
			</view>
			<mk-icon :src="''" :height="16" :width="16"></mk-icon>
		</view>
	</view>
</template>

<script>
import { loginOut } from '@/utils/http'
export default {
	methods: {
		//退出登录
		clearOut() {
			loginOut().then(res => {
				if (uni.getStorageSync('user_info')) {
					uni.removeStorageSync('user_info')
					uni.removeStorageSync('state')
					this.successToShow('退出成功')
					setTimeout(() => {
						this.launch('/pages/login/index')
					}, 1000)
				}
			})
		}
	},
	onLoad() {
		if (!uni.getStorageSync('user_info')) {
			this.launch('/pages/login/index')
		}
	}
}
</script>

<style scoped>
.list-start-card {
	padding: 12px 21px;
	font-size: 16px;
}
.start-item {
	height: 50px;
	line-height: 50px;
}
.start-icon {
	height: 24px;
	width: 24px;
}
</style>